package siga.visao_financeiro;

import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import siga.banco.conexao;
import br.com.adilson.util.PrinterMatrix;
import br.com.adilson.util.Extenso;
import siga.visao.index;
import siga.visao.verErros;


public class movCaixaPagarVer extends javax.swing.JDialog {
    public String Codigo,Nome,DtVenc,Valor,Parcela,btImbTemp;
    public List lcaixa = new ArrayList();
    PrinterMatrix lpt1 = new PrinterMatrix();
    Extenso e = new Extenso();
    public static boolean ConfirmaPagar;
    public static boolean isConfirmaPagar() {
        return ConfirmaPagar;
    }
    public static void setConfirmaPagar(boolean ConfirmaPagar) {
        movCaixaPagarVer.ConfirmaPagar = ConfirmaPagar;
    }
    public movCaixaPagarVer(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jspCBPrincipal = new javax.swing.JSplitPane();
        jpDados = new javax.swing.JPanel();
        jlPessoa = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jlCodigo = new javax.swing.JLabel();
        jlDtVenc = new javax.swing.JLabel();
        jlSaldo = new javax.swing.JLabel();
        jpBaixar = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jtfCaixa = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jtfDataPag = new javax.swing.JFormattedTextField();
        jButton2 = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        jtfJuro = new javax.swing.JTextField();
        jButton3 = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        jtfSaldo = new javax.swing.JTextField();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Confirmação de Entrada de Caixa");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        jspCBPrincipal.setDividerLocation(300);
        jspCBPrincipal.setName("jspCBPrincipal"); // NOI18N

        jpDados.setBorder(javax.swing.BorderFactory.createTitledBorder("Informações de Pagamento"));
        jpDados.setName("jpDados"); // NOI18N
        jpDados.setPreferredSize(new java.awt.Dimension(300, 233));

        jlPessoa.setFont(new java.awt.Font("Tahoma", 1, 14));
        jlPessoa.setText("Nome da Pessoa");
        jlPessoa.setName("jlPessoa"); // NOI18N

        jLabel2.setText("Código:");
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel4.setText("Data de Vencimento:");
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel7.setText("Valor:");
        jLabel7.setName("jLabel7"); // NOI18N

        jlCodigo.setText("jLabel8");
        jlCodigo.setName("jlCodigo"); // NOI18N

        jlDtVenc.setText("jLabel10");
        jlDtVenc.setName("jlDtVenc"); // NOI18N

        jlSaldo.setText("jLabel13");
        jlSaldo.setName("jlSaldo"); // NOI18N

        javax.swing.GroupLayout jpDadosLayout = new javax.swing.GroupLayout(jpDados);
        jpDados.setLayout(jpDadosLayout);
        jpDadosLayout.setHorizontalGroup(
            jpDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDadosLayout.createSequentialGroup()
                .addGroup(jpDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jlPessoa)
                    .addGroup(jpDadosLayout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jlCodigo))
                    .addGroup(jpDadosLayout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jlDtVenc))
                    .addGroup(jpDadosLayout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jlSaldo)))
                .addContainerGap(87, Short.MAX_VALUE))
        );
        jpDadosLayout.setVerticalGroup(
            jpDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDadosLayout.createSequentialGroup()
                .addComponent(jlPessoa)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jlCodigo))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jlDtVenc))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jlSaldo))
                .addContainerGap(171, Short.MAX_VALUE))
        );

        jlPessoa.getAccessibleContext().setAccessibleName("jlPessoa");
        jlCodigo.getAccessibleContext().setAccessibleName("jlCodigo");
        jlDtVenc.getAccessibleContext().setAccessibleName("jlDtVenc");
        jlSaldo.getAccessibleContext().setAccessibleName("jlSaldo");

        jspCBPrincipal.setLeftComponent(jpDados);

        jpBaixar.setBorder(javax.swing.BorderFactory.createTitledBorder("Informações de Pagamento"));
        jpBaixar.setName("jpBaixar"); // NOI18N

        jLabel1.setText("Conta Caixa:");
        jLabel1.setName("jLabel1"); // NOI18N

        jtfCaixa.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jtfCaixa.setEnabled(false);
        jtfCaixa.setName("jtfCaixa"); // NOI18N

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/fechado_16x16.png"))); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel8.setText("Data de Pagamento:");
        jLabel8.setName("jLabel8"); // NOI18N

        jtfDataPag.setEditable(false);
        try {
            jtfDataPag.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDataPag.setName("jtfDataPag"); // NOI18N

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/fechado_16x16.png"))); // NOI18N
        jButton2.setName("jButton2"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel9.setText("Juros:");
        jLabel9.setName("jLabel9"); // NOI18N

        jtfJuro.setEditable(false);
        jtfJuro.setText("0,00");
        jtfJuro.setName("jtfJuro"); // NOI18N
        jtfJuro.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jtfJuroFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                jtfJuroFocusLost(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/fechado_16x16.png"))); // NOI18N
        jButton3.setName("jButton3"); // NOI18N
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jLabel10.setText("Valor Total:");
        jLabel10.setName("jLabel10"); // NOI18N

        jtfSaldo.setEditable(false);
        jtfSaldo.setText("0,00");
        jtfSaldo.setName("jtfSaldo"); // NOI18N

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/fechado_16x16.png"))); // NOI18N
        jButton4.setName("jButton4"); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setText("Pagar");
        jButton5.setName("jButton5"); // NOI18N
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jButton6.setText("Cancelar");
        jButton6.setName("jButton6"); // NOI18N
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jpBaixarLayout = new javax.swing.GroupLayout(jpBaixar);
        jpBaixar.setLayout(jpBaixarLayout);
        jpBaixarLayout.setHorizontalGroup(
            jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpBaixarLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel9)
                    .addComponent(jLabel10)
                    .addGroup(jpBaixarLayout.createSequentialGroup()
                        .addGroup(jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jtfSaldo)
                            .addComponent(jtfJuro, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtfDataPag, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jpBaixarLayout.createSequentialGroup()
                            .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpBaixarLayout.createSequentialGroup()
                            .addComponent(jtfCaixa, javax.swing.GroupLayout.PREFERRED_SIZE, 268, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(14, 14, 14))
        );
        jpBaixarLayout.setVerticalGroup(
            jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpBaixarLayout.createSequentialGroup()
                .addGroup(jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton1)
                    .addGroup(jpBaixarLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfCaixa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jpBaixarLayout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfDataPag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButton2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jpBaixarLayout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfJuro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButton3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jpBaixarLayout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfSaldo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButton4))
                .addGap(18, 18, 18)
                .addGroup(jpBaixarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton5)
                    .addComponent(jButton6))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jspCBPrincipal.setRightComponent(jpBaixar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jspCBPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 638, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jspCBPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        ImgBotao(jButton1);
        jtfCaixa.setEnabled(!jtfCaixa.isEnabled());
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        ImgBotao(jButton2);
        jtfDataPag.setEditable(!jtfDataPag.isEditable());
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        ImgBotao(jButton3);
        jtfJuro.setEditable(!jtfJuro.isEditable());
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        ImgBotao(jButton4);
        jtfSaldo.setEditable(!jtfSaldo.isEditable());
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        JOptionPane.showMessageDialog(null, "Operação Cancelada.","Informação do Sistema",JOptionPane.INFORMATION_MESSAGE);
        dispose();
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        //Object[] JOopcoes = {"Sim","Não"};
        try {
            String dtpag = new SimpleDateFormat("yyyy-MM-dd").format(new SimpleDateFormat("dd/MM/yyyy").parse(jtfDataPag.getText()));
            conexao.Query("Select sysdate() as data");
            conexao.rs.next();
            String hora = new SimpleDateFormat("h:mm:ss").format(conexao.rs.getDate("data"));
            conexao.stm.executeUpdate("update fin_caixa set banco_vl_atual = banco_vl_atual-"+index.ftes.parse(jtfSaldo.getText()).doubleValue()+" where codigo="+lcaixa.get(jtfCaixa.getSelectedIndex())+" and cod_emp="+index.cod_emp);
            conexao.stm.executeUpdate("update fin_contas_mov_p set valor="+index.ftes.parse(jtfSaldo.getText()).doubleValue()+", " +
                    "status=\"Pago\", dt_lancamento=now(), " +
                    " juros="+index.ftes.parse(jtfJuro.getText()).doubleValue()+", dt_processamento=now(), dt_pagamento=\""+dtpag+" "+hora+"\", " +
                    " cod_usuario="+index.usuario[0]+", cod_caixa="+lcaixa.get(jtfCaixa.getSelectedIndex())+" " +
                    "where codigo="+Codigo+" and cod_emp="+index.cod_emp);
            setConfirmaPagar(true);
            /*
            if(JOptionPane.showOptionDialog(null, "Deseja Autenticar agora?","Autenticação",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,JOopcoes,JOopcoes[0])==JOptionPane.YES_OPTION){
               e.setNumber(101.85);
               lpt1.setOutSize(10, 25);
               lpt1.printTextLinCol(1, 1, "SIGA*"+lcaixa.get(jtfCaixa.getSelectedIndex())+"*"+index.usuario[0]+"*"+Codigo+"*"+jtfDataPag.getText()+hora+"*"+jtfSaldo.getText()+"*PAGO");
               lpt1.toPrinter("LPT1");
               if(JOptionPane.showOptionDialog(null, "Autenticar Novamente?","Autenticação",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,JOopcoes,JOopcoes[0])==JOptionPane.YES_OPTION){
                    lpt1.toPrinter("LPT1");
               }
            }
            */
            JOptionPane.showMessageDialog(null, "Operação realizada.","Informação do Sistema",JOptionPane.INFORMATION_MESSAGE);
            dispose();
        } catch (ParseException ex) {
            verErros.setErro(ex.getMessage());
        } catch (SQLException ex) {
            verErros.setErro(ex.getMessage());
        }
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jtfJuroFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jtfJuroFocusLost
        if(jtfJuro.isEditable()){
            try {
                double saldo = index.ftes.parse(jtfSaldo.getText()).doubleValue() + index.ftes.parse(jtfJuro.getText()).doubleValue();
                jtfSaldo.setText(index.ftbr.format(saldo));
            } catch (ParseException ex) {
               verErros.setErro(ex.getMessage());
            }
        }
    }//GEN-LAST:event_jtfJuroFocusLost

    private void jtfJuroFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jtfJuroFocusGained
        if(jtfJuro.isEditable()){
            try {
                double saldo = index.ftes.parse(jtfSaldo.getText()).doubleValue() - index.ftes.parse(jtfJuro.getText()).doubleValue();
                jtfSaldo.setText(index.ftbr.format(saldo));
            } catch (ParseException ex) {
                verErros.setErro(ex.getMessage());
            }
        }
    }//GEN-LAST:event_jtfJuroFocusGained

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        try {
            jlCodigo.setText(Codigo);
            jlDtVenc.setText(DtVenc);
            jlSaldo.setText(Valor);
            jlPessoa.setText(Nome);
            String datac = new SimpleDateFormat("dd/MM/yyyy").format(new Date());
            jtfDataPag.setText(datac);
            double valor = (Valor.isEmpty()) ? 0.00 : index.ftes.parse(Valor).doubleValue();
            jtfSaldo.setText(index.ftbr.format(valor));
            jtfCaixa.removeAllItems();
            try {
                conexao.Query("select fc.codigo, fc.descricao from fin_caixa fc inner join usuarios_caixas uc on uc.cod_caixa=fc.codigo and uc.cod_emp=fc.cod_emp" + " where uc.cod_usuario=" + index.usuario[0] + " and fc.cod_emp=" + index.cod_emp + " order by uc.status");
                jtfCaixa.removeAllItems();
                while (conexao.rs.next()) {
                    jtfCaixa.addItem(conexao.rs.getString("descricao"));
                    lcaixa.add(conexao.rs.getString("codigo"));
                }
            } catch (SQLException ex) {
                verErros.setErro(ex.getMessage());
            }
        } catch (ParseException ex) {
            verErros.setErro(ex.getMessage());
        }
    }//GEN-LAST:event_formWindowOpened

    public static void main(final String args[]) {
        JOptionPane.showMessageDialog(null, "Operação Cancelada.","Informação do Sistema",JOptionPane.INFORMATION_MESSAGE);
    }
    private void ImgBotao(JButton ImgTmp){
        ImageIcon btImg1 = new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/aberto_16x16.png"));
        ImageIcon btImg2 = new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/fechado_16x16.png"));
        if(ImgTmp.getIcon().toString().equals(btImg1.toString())){
            ImgTmp.setIcon(btImg2);
        }else {
            ImgTmp.setIcon(btImg1);
        }
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jlCodigo;
    private javax.swing.JLabel jlDtVenc;
    private javax.swing.JLabel jlPessoa;
    private javax.swing.JLabel jlSaldo;
    private javax.swing.JPanel jpBaixar;
    private javax.swing.JPanel jpDados;
    private javax.swing.JSplitPane jspCBPrincipal;
    private javax.swing.JComboBox jtfCaixa;
    private javax.swing.JFormattedTextField jtfDataPag;
    private javax.swing.JTextField jtfJuro;
    private javax.swing.JTextField jtfSaldo;
    // End of variables declaration//GEN-END:variables

}
